<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/gui/painting/qcolormap_x11.cpp -->
<head>
  <title>Qt 4.3: QColormap Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QColormap Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QColormap class maps device independent QColors to device dependent pixel values. <a href="#details">More...</a></p>
<pre> #include &lt;QColormap&gt;</pre><ul>
<li><a href="qcolormap-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h3>Public Types</h3>
<ul>
<li><div class="fn"/>enum <b><a href="qcolormap.html#Mode-enum">Mode</a></b> { Direct, Indexed, Gray }</li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qcolormap.html#QColormap">QColormap</a></b> ( const QColormap &amp; <i>colormap</i> )</li>
<li><div class="fn"/><b><a href="qcolormap.html#dtor.QColormap">~QColormap</a></b> ()</li>
<li><div class="fn"/>const QColor <b><a href="qcolormap.html#colorAt">colorAt</a></b> ( uint <i>pixel</i> ) const</li>
<li><div class="fn"/>const QVector&lt;QColor&gt; <b><a href="qcolormap.html#colormap">colormap</a></b> () const</li>
<li><div class="fn"/>int <b><a href="qcolormap.html#depth">depth</a></b> () const</li>
<li><div class="fn"/>Mode <b><a href="qcolormap.html#mode">mode</a></b> () const</li>
<li><div class="fn"/>uint <b><a href="qcolormap.html#pixel">pixel</a></b> ( const QColor &amp; <i>color</i> ) const</li>
<li><div class="fn"/>int <b><a href="qcolormap.html#size">size</a></b> () const</li>
<li><div class="fn"/>QColormap &amp; <b><a href="qcolormap.html#operator-eq">operator=</a></b> ( const QColormap &amp; <i>colormap</i> )</li>
</ul>
<a name="static-public-members"></a>
<h3>Static Public Members</h3>
<ul>
<li><div class="fn"/>HPALETTE <b><a href="qcolormap.html#hPal">hPal</a></b> ()</li>
<li><div class="fn"/>QColormap <b><a href="qcolormap.html#instance">instance</a></b> ( int <i>screen</i> = -1 )</li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QColormap class maps device independent QColors to device dependent pixel values.</p>
<hr />
<h2>Member Type Documentation</h2>
<h3 class="fn"><a name="Mode-enum"></a>enum QColormap::Mode</h3>
<p>This enum describes how <a href="qcolormap.html">QColormap</a> maps device independent RGB values to device dependent pixel values.</p>
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QColormap::Direct</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Pixel values are derived directly from the RGB values, also known as &quot;True Color.&quot;</td></tr>
<tr><td valign="top"><tt>QColormap::Indexed</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Pixel values represent indexes into a vector of available colors, i.e&#x2e; <a href="qcolormap.html">QColormap</a> uses the index of the color that most closely matches an RGB value.</td></tr>
<tr><td valign="top"><tt>QColormap::Gray</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Similar to <tt>Indexed</tt>, pixel values represent a vector of available gray tones. <a href="qcolormap.html">QColormap</a> uses the index of the gray tone that most closely matches the computed gray tone of an RGB value.</td></tr>
</table></p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QColormap"></a>QColormap::QColormap ( const QColormap &amp; <i>colormap</i> )</h3>
<p>Constructs a copy of another <i>colormap</i>.</p>
<h3 class="fn"><a name="dtor.QColormap"></a>QColormap::~QColormap ()</h3>
<p>Destroys the colormap.</p>
<h3 class="fn"><a name="colorAt"></a>const <a href="qcolor.html">QColor</a> QColormap::colorAt ( <a href="qtglobal.html#uint-typedef">uint</a> <i>pixel</i> ) const</h3>
<p>Returns a <a href="qcolor.html">QColor</a> for the <i>pixel</i>.</p>
<p>See also <a href="qcolormap.html#pixel">pixel</a>().</p>
<h3 class="fn"><a name="colormap"></a>const <a href="qvector.html">QVector</a>&lt;<a href="qcolor.html">QColor</a>&gt; QColormap::colormap () const</h3>
<p>Returns a vector of colors which represents the devices colormap for <tt>Indexed</tt> and <tt>Gray</tt> modes. This function returns an empty vector for <tt>Direct</tt> mode.</p>
<p>See also <a href="qcolormap.html#size">size</a>().</p>
<h3 class="fn"><a name="depth"></a>int QColormap::depth () const</h3>
<p>Returns the depth of the device.</p>
<p>See also <a href="qcolormap.html#size">size</a>().</p>
<h3 class="fn"><a name="hPal"></a>HPALETTE QColormap::hPal ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>This function is only available on Windows.</p>
<p>Returns an handle to the HPALETTE used by this colormap. If no HPALETTE is being used, this function returns zero.</p>
<h3 class="fn"><a name="instance"></a>QColormap QColormap::instance ( int <i>screen</i> = -1 )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Returns the colormap for the specified <i>screen</i>. If <i>screen</i> is -1, this function returns the colormap for the default screen.</p>
<h3 class="fn"><a name="mode"></a><a href="qcolormap.html#Mode-enum">Mode</a> QColormap::mode () const</h3>
<p>Returns the mode of this colormap.</p>
<p>See also <a href="qcolormap.html#Mode-enum">QColormap::Mode</a>.</p>
<h3 class="fn"><a name="pixel"></a><a href="qtglobal.html#uint-typedef">uint</a> QColormap::pixel ( const <a href="qcolor.html">QColor</a> &amp; <i>color</i> ) const</h3>
<p>Returns a device dependent pixel value for the <i>color</i>.</p>
<p>See also <a href="qcolormap.html#colorAt">colorAt</a>().</p>
<h3 class="fn"><a name="size"></a>int QColormap::size () const</h3>
<p>Returns the size of the colormap for <tt>Indexed</tt> and <tt>Gray</tt> modes; Returns -1 for <tt>Direct</tt> mode.</p>
<p>See also <a href="qcolormap.html#colormap">colormap</a>().</p>
<h3 class="fn"><a name="operator-eq"></a>QColormap &amp; QColormap::operator= ( const QColormap &amp; <i>colormap</i> )</h3>
<p>Assigns the given <i>colormap</i> to <i>this</i> color map and returns a reference to <i>this</i> color map.</p>
<p>This function was introduced in Qt 4.2.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
